//
//  UserDataBaseTool.h
//  AAIM
//
//  Created by awh on 2019/12/28.
//  Copyright © 2019年 AAIM. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "ContactModel.h"
#import "PublicModel.h"
NS_ASSUME_NONNULL_BEGIN

@interface UserDataBaseTool : NSObject
+ (instancetype)shareUserDataBaseTool;

// 创表，登录成功后调用
- (void)createTable;
//保存
- (void)SaveFriendsWithGroupsDataSuccess:(void(^)(BOOL isOK))Success;
//1好友 2群 3公众号
-(void)reloadData:(NSInteger)type Success:(void(^)(BOOL isOK))Success;
//赠 改
- (void)saveContactModel:(ContactModel *)model type:(NSInteger)type;
//查询全部好友
- (NSArray<ContactModel *> *)queryAllFriends;
//查询全部群
- (NSArray<ContactModel *> *)queryAllGroups;

//自己是否在该群  yes存在 no不存在
-(BOOL)isGroupMembersWithgId:(NSInteger)gId;

//查询单个好友
- (ContactModel *)queryFriends:(NSString*)fuuid;
//查询单个群
- (ContactModel *)queryGroup:(NSString*)groupid;
//删除单个好友
- (void)deleteFriend:(NSString*)fuuid;
//删除单个群
- (void)deleteGroup:(NSString*)groupid;
//重新登录删除之前缓存数据
-(void)deleteFriendWithGroupData;

//公众号
//保存
- (void)SavePublicDataSuccess:(void(^)(BOOL isOK))Success;

//赠 改
- (void)savePublicModel:(PublicModel *)model type:(NSInteger)type;
//查询全部公众号
- (NSArray<PublicModel *> *)queryAllPublic;

//查询单个公众号
- (PublicModel *)queryPublicUdid:(NSString*)udid;
//取消关注单个公众号
- (void)deletePublicUdid:(NSString*)udid;
@end

NS_ASSUME_NONNULL_END
